package com.itheima;

import java.util.Scanner;

public class 用户登录 {
    public static void main(String[] args) {
        String username = "admin";
        String password = "123456";

        for (int i = 1; i <= 3; i++) {
            Scanner sc = new Scanner(System.in);

            System.out.println("请输入你的账号：");
            String scusername = sc.nextLine();
            System.out.println("请输入你的密码：");
            String scpsssword = sc.nextLine();
            System.out.println("请再次输入确认密码：");
            String scqurenpsssword = sc.nextLine();

            if (username.equals(scusername) && password.equals(scpsssword) && scpsssword.equals(scqurenpsssword)) {
                System.out.println("登陆成功");
                break;
            } else {
                if (i == 3) {
                    System.out.println("账户已锁定，明天再来吧");
                } else {
                    System.out.println("输入错误，你还有" + (3 - i) + "次机会");
                }
            }
        }
    }
}
